{template 'admin','header'}
{if check_perms('ip002')===true}
<form action="{$self_url}?action=add" onsubmit="return r_submit(this);">
<table class="table_form" width="100%" cellpadding="0">
 <caption>添加ip禁止</caption>
<tr>
	<td><strong>IP地址:</strong><input type="text" id="addip" name="ip">&nbsp;&nbsp;&nbsp;&nbsp;<strong>封禁时间:</strong>{date_tool('expires')}<font color="Gray">不填为永不过期</font>&nbsp;<input type="submit" value="添加"></td>
	
</tr>
</table>
</form>
<br/><br/>
{/if}
<form action="{$self_url}?action=search" onsubmit="return r_submit(this);">
<table width="100%" cellpadding="0">
<tr>
	<td width="180"><strong>IP地址:</strong><input type="text" name="ip" value="{$ip}"></td>
	<td><input type="submit" value="搜索"></td>	
</tr>
</table>
</form>


<form name='form1' action="{$self_url}?action=delall" method="POST" onsubmit="return r_submit(this);">
<table class="table_list">
 <caption>ip禁止管理列表</caption>
 <tr>
	 <th width="80" class="align_c"><input type="checkbox" onclick="checkall(this,'ck')" id="chkall">全选/取消</th>
	 <th class="align_c">IP</th>
	 <th class="align_c">封禁时间</th>
	 {if check_perms('ip003')===true}
	 <th width="250" class="align_c">删除</th>
	 {/if}
 </tr>
 {loop $list $i}
 <tr>
 <td class="align_c"><input type="checkbox" id="ck" value="{$i['ip']}" name="ck[]"></td>
 <td>{$i['ip']}</td>
 <td class="align_c">{if $i['expires']>0}{date('Y-m-d',$i['expires'])}{else}永不过期{/if}</td>
 {if check_perms('ip003')===true}
 <td class="align_c">
 <a href="javascript:my_request('{$self_url}?action=del&ip={urlencode($i['ip'])}','确认要删除吗？')">删除</a>
 </td>
 {/if}
 </tr>
 {/loop}
</table>
<div class="button_box">
{if check_perms('ip003')===true}
<input type="button" value="批量删除" onclick="if(confirm('确定要删除选中的ip？')){change_opt('form1','{$self_url}?action=delall');}" class="button_style">
<input type="button" value="删除所有过期ip" onclick="if(confirm('确定要删除所有过期ip？')){change_opt('form1','{$self_url}?action=flush');}" class="button_style">
{/if}
</div>
</form>

<div id="pages">
{$pages}
</div>
{template 'admin','footer'}